package com.cloudfactory.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.cloudfactory.po.IncubatorBase;
import com.cloudfactory.service.IncubatorBaseService;

@Controller
@RequestMapping(value = "/")
public class FactoryController {

	@Autowired
	private IncubatorBaseService incubatorBaseService;

	@RequestMapping(value = "/factory")
	public String factory(Model model) {
		List<IncubatorBase> list = incubatorBaseService.selectAll();
		if (list != null && !list.isEmpty()) {
			model.addAttribute("incubatorBase", list.get(0));
		}
		return "/factory.jsp";
	}
}
